package com.demo.samples.property;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TestConditionalOnProperty {
    @Bean
    @ConditionalOnProperty(prefix = "filter", name = "loginFilter", havingValue = "true")
    public void filter() {
        log.info("加载filter-------------");
    }
}
